package com.ruoyi.system.service.life.impl;


import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.life.LifeZhouYi;
import com.ruoyi.system.mapper.life.LifeZhouYiMapper;
import com.ruoyi.system.service.life.ILifeZhouYiService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 周易Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-30
 */
@Service
public class LifeZhouYiServiceImpl implements ILifeZhouYiService {
    @Resource
    private LifeZhouYiMapper lifeZhouYiMapper;

    /**
     * 查询周易
     *
     * @param lGuaId 周易主键
     * @return 周易
     */
    @Override
    public LifeZhouYi selectLifeZhouYiByLGuaId(Long lGuaId) {
        return lifeZhouYiMapper.selectLifeZhouYiByLGuaId(lGuaId);
    }

    /**
     * 查询周易列表
     *
     * @param lifeZhouYi 周易
     * @return 周易
     */
    @Override
    public List<LifeZhouYi> selectLifeZhouYiList(LifeZhouYi lifeZhouYi) {
        return lifeZhouYiMapper.selectLifeZhouYiList(lifeZhouYi);
    }

    /**
     * 新增周易
     *
     * @param lifeZhouYi 周易
     * @return 结果
     */
    @Override
    public int insertLifeZhouYi(LifeZhouYi lifeZhouYi) {
        lifeZhouYi.setCreateTime(DateUtils.getNowDate());
        return lifeZhouYiMapper.insertLifeZhouYi(lifeZhouYi);
    }

    /**
     * 修改周易
     *
     * @param lifeZhouYi 周易
     * @return 结果
     */
    @Override
    public int updateLifeZhouYi(LifeZhouYi lifeZhouYi) {
        lifeZhouYi.setUpdateTime(DateUtils.getNowDate());
        return lifeZhouYiMapper.updateLifeZhouYi(lifeZhouYi);
    }

    /**
     * 批量删除周易
     *
     * @param lGuaIds 需要删除的周易主键
     * @return 结果
     */
    @Override
    public int deleteLifeZhouYiByLGuaIds(Long[] lGuaIds) {
        return lifeZhouYiMapper.deleteLifeZhouYiByLGuaIds(lGuaIds);
    }

    /**
     * 删除周易信息
     *
     * @param lGuaId 周易主键
     * @return 结果
     */
    @Override
    public int deleteLifeZhouYiByLGuaId(Long lGuaId) {
        return lifeZhouYiMapper.deleteLifeZhouYiByLGuaId(lGuaId);
    }
}
